home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
dev
/
misc
/
egs.lha
/
EGS
/
EGS_Devels
/
Examples
/
Beginner_Gadgets
/
gadget1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-02-16
|
2KB
|
76 lines
/**************************************************************************
***** Gadget Demo 1 *****
***** *****
***** by John J. Karcher *****
***** *****
***** 4 August 1992 *****
***** 10 Jan 1993 mvk *****
***** *****
**************************************************************************/
/*
This program opens up a window with a single gadget in it, using
egsgadbox.library. It is not smart; it merely calls Delay() and
closes.
*/
#include <stdio.h>
#include <stdlib.h>
#include <exec/types.h>
#include <proto/all.h>
#include <egs/egsintui.h>
#include <egs/egsgadbox.h>
#include <egs/proto/all.h>
struct EI_Window *CreateWindow(void);
struct Library *EGSIntuiBase;
struct Library *EGBBase;
struct EB_GadContextNode *GadCon;
struct EI_Window *CreateWindow(void)
{
struct EI_Window *ret = NULL;
EB_GadBoxPtr root;
if (GadCon = EB_CreateGadContext(NULL, NULL, -1, -1))
{
if (root = EB_CreateTextAction(GadCon, "Useless", 1, EB_FILL_ALL))
{
if (EB_ProcessGadBoxes(GadCon, root))
{
GadCon->NewWin->Title = "EGS Gadget Demo 1";
GadCon->NewWin->Width = 200;
GadCon->NewWin->Height= 100;
GadCon->NewWin->Flags = EI_WINDOWCENTER;
ret = EI_OpenWindow(GadCon->NewWin);
}
}
}
return ret;
}
main()
{
struct EI_Window *Win;
if (EGSIntuiBase = OpenLibrary("egsintui.library", 0))
{
if (EGBBase = OpenLibrary("egsgadbox.library", 0))
{
if (Win = CreateWindow())
{
Delay(250);
}
if (Win) EI_CloseWindow(Win);
if (GadCon) EB_DeleteGadContext(GadCon);
CloseLibrary(EGBBase);
}
CloseLibrary(EGSIntuiBase);
}
}